﻿@model IEnumerable<HdipCricketClub.Models.Opponent>

@{
    ViewBag.Title = "Opponents:";
}

<h2>@ViewBag.Title</h2>

@using (@Html.BeginForm())
{
    <p>
    Find by Club Name: @Html.TextBox("searchString")
    <input type="submit" value="Search" />
    </p>
}

<table>
    <tr>
        <th>
            Club:
        </th>
        <th>
            Team:
        </th>
        <th>
            Address:
        </th>
        <th>
            Phone:
        </th>
        <th>
            E mail:
        </th>
        <th>
            Contact:
        </th>
     </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.club_name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.team_name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.address_1),
            @if (item.address_2 != null)
            {    
                @Html.DisplayFor(modelItem => item.address_2)@:,
            }
            @Html.DisplayFor(modelItem => item.town_city),
            @Html.DisplayFor(modelItem => item.county).
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.phone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.contact_name)
        </td>
     </tr>
}

</table>
